Skip to content

Upgrade: Improve heuristics around important codemod#14774

Merged
adamwathan merged 2 commits into
nextfrom
10-24-upgrade_improve_heuristics_around_important_codemod
Oct 24, 2024
Merged

Upgrade: Improve heuristics around important codemod#14774
adamwathan merged 2 commits into
nextfrom
10-24-upgrade_improve_heuristics_around_important_codemod

Conversation

@philipp-spiess

@philipp-spiess philipp-spiess commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

This PR improves the heuristics around the important codemod (e.g. !border => border!) as we noticed a few more cases where we the current heuristics was not enough.

Specifically, we made it not migrate the candidate in the following conditions:

  • When there's an immediate property access: { "foo": !border.something + ""}
  • When it's used as condition in the template language: <div v-if="something && !border"></div> or <div x-if="!border"></div>

Test plan

I added test cases to the unit tests and updated the integration test to contain a more sophisticated example.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @philipp-spiess and the rest of your teammates on Graphite Graphite

@philipp-spiess philipp-spiess marked this pull request as ready for review October 24, 2024 12:26
@philipp-spiess philipp-spiess requested a review from a team as a code owner October 24, 2024 12:26
@philipp-spiess philipp-spiess force-pushed the 10-24-upgrade_improve_heuristics_around_important_codemod branch 2 times, most recently from 9bce67f to 6b28e58 Compare October 24, 2024 12:27
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts Outdated
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts Outdated
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts Outdated
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts Outdated
Comment thread packages/@tailwindcss-upgrade/src/template/codemods/important.ts Outdated
Comment thread CHANGELOG.md Outdated
@philipp-spiess philipp-spiess force-pushed the 10-24-upgrade_improve_heuristics_around_important_codemod branch from ddee4c6 to 8abbc77 Compare October 24, 2024 15:21
@adamwathan adamwathan merged commit 3f2afaf into next Oct 24, 2024
@adamwathan adamwathan deleted the 10-24-upgrade_improve_heuristics_around_important_codemod branch October 24, 2024 15:31
chloepriceless added a commit to chloepriceless/proxmox-gui that referenced this pull request May 14, 2026
Tailwind v4's oxide Rust backend needs @tailwindcss/oxide-linux-x64-gnu
as a sibling at runtime. pnpm 11.1.1 with default 'isolated' linker
sometimes fails to create the required nested symlink in
.pnpm/@tailwindcss+oxide/node_modules/@tailwindcss/, even though the
platform package is installed in the store.
Known issue: github.com/tailwindlabs/tailwindcss/issues/14774.

Fix: write 'node-linker=hoisted' to frontend/.npmrc before pnpm install.
This switches pnpm to npm-style flat node_modules layout, so
require('@tailwindcss/oxide-linux-x64-gnu') resolves the way every
npm tool expects.

Verified local layout (isolated linker, works there):
  node_modules/.pnpm/@tailwindcss+oxide@4.3.0/node_modules/@tailwindcss/
    ├── oxide/                          (main package)
    └── oxide-linux-x64-gnu -> ../../../@tailwindcss+oxide-linux-x64-gnu@.../...

In the LXC the second entry was missing despite '+338 packages' being
reported by pnpm — silent skip of the platform optional dep symlink.
Hoisted layout sidesteps the bug entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants